﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Smart.Navigation;
using Smart.Navigation.Parameter;

namespace NavigationSampleApp.Views
{
    [View(ViewId.DataList)]
    public partial class DataListView : AppViewBase
    {
        [ViewParameter(Direction.Export)]
        protected string selectedId;

        /// <summary>
        /// 
        /// </summary>
        public DataListView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 
        /// </summary>
        public override void OnButtonExit()
        {
            Navigator.Forward( ViewId.Menu );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        public override void OnViewOpen(ViewForwardEventArgs args)
        {
            // ファンクションキー
            FunctionCotrol.UpdateFunctionKeys( null );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NewButton_Click(object sender, EventArgs e)
        {
            Navigator.Push( ViewId.DataDetailNew );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EditButton_Click(object sender, EventArgs e)
        {
            // データ123選択
            this.selectedId = "123";

            Navigator.Push( ViewId.DataDetailEdit );
        }
    }
}